/*
 * filter.h
 *
 *  Created on: Jun 9, 2011
 *      Author: Erich Malzer
 */

#ifndef FILTER_H_
#define FILTER_H_
#include <fftw3.h>

class CFilter {
public:
	/*
	 */
	CFilter();

	virtual ~CFilter();

	/**
	 * Changes the filter settings.
	 *
	 * @param pMin             The minimum frequency in Hz
	 * @param pMax             The maximum frequency in Hz
	 * @param pSampleRate      The sample rate in samples per second
	 * @param pFftFrameSize    The FFT frame size
	 */
	void changeFilters(unsigned int pMin, unsigned int pMax, unsigned int pSampleRate, unsigned int pFftFrameSize);

	/*
	 *
	 */
	/**
	 * Applies the filter with the properties set with changeFilters(). This function
	 * cuts all frequencies higher than pMax and lower than pMin.
	 *
	 * @param pFftData         The audio signal to be processed
	 * @param pFftFrameSize    The FFT frame size
	 */
	void cutFrequencies(fftw_complex *pFftData, unsigned int pFftFrameSize);

	/**
	 * Getter method for the mMin member variable.
	 */
	unsigned int getMin();

	/**
	 * Getter method for the mMax member variable.
	 */
	unsigned int getMax();

private:
	unsigned int mMin;	//Highpassfilter
	unsigned int mMax;	//Lowpassfilter
};

#endif /* FILTER_H_ */
